public class LQB_code1_3 {
    public static void main(String[] args) {
        long count=0;
        for (int i=1;i<=2019;i++){
            //将数字转为字符串
            String j = i + "";
            //将字符串转成字符数组 toCharArray()
            char[] ch = j.toCharArray();
            for (char c:ch){ //传统方法遍历数组
                if(c=='2'||c=='0'||c=='1'||c=='9'){
                    count+=i;
                    break;
                }
            }
        }
        System.out.println(count);
    }
}
